{{#if permissions.moderate}}
  <div class="discussion-column">
    <span class="discussion-drag-handle"
          tabindex="0"
          data-tooltip
          title="{{#t}}Drag up or down to reorder{{/t}}"></span>
  </div>
{{/if}}

{{#if permissions.delete}}
  <label class="discussion-column">
    <input class="toggleSelected" type="checkbox" aria-label="{{title}}" {{#if selected}}checked{{/if}} >
  </label>
{{/if}}
<div class="discussion-column image-block">
  <div class="image-block-content">
    <div>
      <div class="image-block-image" aria-hidden="true">
        {{>avatar author}}
      </div>
      <a href="{{html_url}}" class="discussion-title" >{{title}}</a>
      {{#if author}}
        <a class="discussion-author" href="{{author.html_url}}">{{author.display_name}}</a>
      {{/if}}
      <div class="discussion-summary ellipsis">{{summary}}</div>
    </div>
    <div class="discussion-actions-container">
      <div class="discussion-unread-container">
        <div class="new-and-total-badge">
          <span class="new-items"
                data-tooltip
                title="{{unread_count_tooltip}}">{{#if unread_count}}{{n unread_count}}{{/if}}</span>
          <span class="total-items"
                data-tooltip
                title="{{reply_count_tooltip}}">{{#if discussion_subentry_count}}{{n discussion_subentry_count}}{{/if}}</span>
        </div>
      </div>
      <div class="discussion-last-reply">
        {{friendlyDatetime last_reply_at contextSensitive=true}}
      </div>
      <span data-view="lock-icon" class="lock-icon"></span>
      <div class="discussion-info-icons">
        {{#if locked}}
          <i data-tooltip
             title="{{#t}}This topic is closed for comments{{/t}}"
             class="icon-lock"
             tabindex="0"></i>
        {{/if}}

        {{#if podcast_url}}
          <a href="{{podcast_url}}"
             data-tooltip
             title="{{#t}}Topic Podcast Feed{{/t}}"><i class="icon-rss"></i></a>
        {{/if}}

        {{#each attachments}}
          <a href="{{url}}"
             data-tooltip
             title="{{#t}}Attached: {{display_name}}{{/t}}"><i class="icon-paperclip"></i></a>
        {{/each}}
        {{#if assignment_id}}
          <i data-tooltip
             title="{{#t}}This topic is used for grading{{/t}}"
             class="icon-assignment"></i>
        {{/if}}
      </div>
      <div class="discussion-actions">
        {{#unless restricted_by_master_course}}
        {{#if permissions.delete}}
          <a href="#" class="al-trigger al-trigger-gray" role="button" id="manage_link" aria-haspopup="true">
            <i class="icon-settings"></i><i class="icon-mini-arrow-down"></i>
            
          </a>

          <ul class="al-options">
            {{#if locked}}
                {{#unless comments_disabled}}
                  <li>
                    <a href="#" class="icon-lock">
                      {{#t}}Open to Comments{{/t}}
                    </a>
                  </li>
                {{/unless}}
            {{else}}
              {{#if can_lock}}
                <li>
                  <a href="#" class="icon-lock">
                    {{#t}}Close for Comments{{/t}}
                  </a>
                </li>
              {{/if}}
            {{/if}}
            <li>
              <a href="#" class="icon-trash">{{#t}}Delete{{/t}}</a>
            </li>
          </ul>
        {{/if}}
        {{/unless}}
      </div>
    </div>
  </div>
</div>
